var AV = require('leanengine');

//测试
//var APP_ID =  'jj3H5SHAbfnPp46r1IY19OrJ-gzGzoHsz'; // your app id
//var APP_KEY =  'zMJg1ga63OjxznPH4c1LvfyM'; // your app key
//var MASTER_KEY =  'U7djq4nL11lbr4kIreVTPSw9'; // your app master key
//正式
var APP_ID =  'wtIXIN8WQp9WBtG4UnhcXYh3-gzGzoHsz'; // your app id
var APP_KEY =  'K9vj24pKqpyRDkln8J7AOPxu'; // your app key
var MASTER_KEY =  'O4PDyylbzS9XSPJNSukqlszh'; // your app master key


AV.initialize(APP_ID, APP_KEY, MASTER_KEY);

// 如果不希望使用 masterKey 权限，可以将下面一行删除
AV.Cloud.useMasterKey();
//AV.setPromisesAPlusCompliant(false);

var app = require('./app');

// 端口一定要从环境变量 `LC_APP_PORT` 中获取。
// LeanEngine 运行时会分配端口并赋值到该变量。
var PORT = parseInt(process.env.LC_APP_PORT || 3000);
app.listen(PORT, function() {
	console.log('Node app is running, port:', PORT);
});